package com.neuedu.corejava.ch10;

import java.util.Stack;

public class StackClass {

	public static void main(String[] args) {
		//栈结构
		
		Stack<Computer> stack = new Stack<>();
		
		//压栈
		for (int i = 0; i < 10; i++) {
			stack.push(new Computer("HP"+i,5000+i));
		}
			
		//弹栈
		Computer computer = null;
		while ((computer=stack.pop())!=null) {
			if (stack.isEmpty()) {
				break;
			}
			System.out.println(computer);	
		}
		

	}

}
